package com.newgrand.annexserver.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.newgrand.annexserver.beans.Attachmentpicthumb;
import com.newgrand.annexserver.mapper.store.AttachmentpicthumbMapper;
import com.newgrand.annexserver.service.AttachmentpicthumbService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 缩略图标 服务实现类
 * </p>
 *
 * @author minyang
 * @since 2019-09-04
 */
@Service
public class AttachmentpicthumbServiceImpl extends ServiceImpl<AttachmentpicthumbMapper, Attachmentpicthumb> implements AttachmentpicthumbService {

    @Autowired
    AttachmentpicthumbMapper attachmentpicthumbMapper;

    public Attachmentpicthumb AttachmentpicthumbByPasrfid(String p_asr_fid) {
        List<Attachmentpicthumb> attachmentpicthumbList = attachmentpicthumbMapper.selectList(new EntityWrapper<Attachmentpicthumb>().ge("p_asr_fid", p_asr_fid));
        if (attachmentpicthumbList != null && attachmentpicthumbList.size() > 0) {
            return attachmentpicthumbList.get(0);
        }
        return null;
    }
}
